<template>
  <div>
  <div v-html="html" class="xieyi"></div>
    <Spin fix v-show="isSpinShow" >
      <div class="loader">
        <Icon type="ios-loading" size=26 class="demo-spin-icon-load"></Icon>
        <div class="font14">加载中...</div>
      </div>
    </Spin>
  </div>
</template>
<style scoped lang="less" rel="stylesheet/less">
  /* 旋转效果 */
  .demo-spin-icon-load{
    animation: ani-demo-spin 1s linear infinite;
  }
  @keyframes ani-demo-spin {
    from { transform: rotate(0deg);}
    50% { transform: rotate(180deg);}
    to { transform: rotate(360deg);}
  }
  /* 假如内容过长，一屏放不下，滚动条下拉覆盖不全 */
  .ivu-spin-fix {
    position: fixed;
  }

    .xieyi{
      text-align: left;
      line-height: 30px;
      font-size: 14px;
      background-color: #fff;
      padding: 35px;
      ul li{
        list-style: none;
      }
    }

</style>
<script type="text/ecmascript-6">
  import {getHtmlWeb} from "../../http";

    export default {
       name: "html",
       props:[],
       data() {
         return{
           html:this.$route.query.html,      //页面内容
           type:this.$route.query.type,   //页面类型
           isSpinShow:false,
         }
       },
      methods:{},
      created() {
         //请求页面数据
        if(this.isSpinShow === false) {
          this.isSpinShow = true;
          getHtmlWeb({type: this.type}).then(res => {
            this.isSpinShow = false;
            this.html = res.data.html.htmlContent;
            this.$route.meta.title = res.data.html.htmlTitle;
          }).catch()
        }
      }
    }
</script>

